<template>
    <div class="order">
        <div class="title">担保管理列表</div>
        <div class="order-content">
            <label class="filterText">关键字</label>
            <el-input class="order-input-filter" placeholder="请输入姓名/身份证号/手机号码" v-model="filterText" >
            </el-input>
            <el-button class="filter-button-search" type="primary" icon="search" @click="search">搜索</el-button>
            <el-table class="order-table" :data="tableData" style="width: 100%" empty-text="暂无搜索结果">
                <el-table-column prop="orderNo" label="订单号" width="160">
                </el-table-column>
                <el-table-column prop="customerName" label="姓名" width="100">
                </el-table-column>
                <el-table-column prop="customerIdCard" label="身份证号" width="200">
                </el-table-column>
                <el-table-column prop="mobilePhone" label="手机号" width="130">
                </el-table-column>
                <el-table-column prop="residentialAddr" label="地址" width="200">
                </el-table-column>
                <el-table-column prop="deptName" label="业务部门" width="180">
                </el-table-column>
                <el-table-column prop="staffName" label="业务员" width="120">
                </el-table-column>
                <el-table-column label="操作" width="100">
                    <template scope="scope">
                        <el-button type="text" size="small" @click="deal(scope.row)">处理</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <div class="order-pagination">
                <el-pagination layout="sizes,prev, pager, next" @current-change="getCurrentPage"
                     :page-sizes="[10,20,30,50]" :total="total"
                     :page-size="pagesize"
                     :current-page.sync="currentPage"
                     @size-change="sizeChange"
                     style="text-align: center;margin-top: 20px">
                </el-pagination>
            </div>
        </div>
    </div>
</template>
<script>
import ElForm from "../../../node_modules/element-ui/packages/form/src/form.vue";
import { Loading } from 'element-ui';
export default {
    components: {},
    data() {
        return {
            filterText:'',
            tableData:[],
            pagesize: 10,
            currentPage:1,
            total: 10,
        }
    },
    methods: {
        sizeChange(val){
            this.pagesize = val
        },

        getCurrentPage(currentPage){
            this.currentPage = currentPage
          },

        deal(row){
            this.$router.push({path:'/AssetProtection/GuaranteeManageDetail',query:{customerIdCard:row.customerIdCard,orderNo:row.orderNo}})
        },

        getGuaranteeList(){
            this.$http.get('/order/orders',{
                params:{
                    keyword:this.filterText,
                    pageSize:this.pagesize,
                    pageNO:this.currentPage
                }
            })
            .then((response)=>{
                this.tableData = response.data.data.result
            })
            .catch((error)=>{
                console.log(error)
            })
        },

        search(){
            this.getGuaranteeList()
        }
        
    },
    mounted() {
    }
}

</script>
<style lang="scss" scoped>
.order {
    padding: 10px 16px;

    .title {
        color: #99A9BF;
        font-size: 14px;
        line-height: 18px;
        margin: 8px 0px 10px 0px;
    }
    .order-content {
        background: #fff;
        padding: 20px;
        overflow: auto;
        position: absolute;
        bottom: 20px;
        left: 20px;
        right: 20px;
        top: 45px;
        .order-add-button {
            color: #fff;
        }
        .filterText {
            font-size: 14px;
            color: #475669;
            margin: 0px 5px 0px 15px;
        }
        .order-hr {
            margin: 20px 0px 30px 0px;
            background: #D3DCE6;
        }
        .order-input-selemanName {
            width: 190px;
            margin-bottom: 10px;
            .order-input-name {
                width: 90px;
            }
        }
        .order-input-filter {
            width: 285px;
        }
        .filter-button-search {
            margin-left: 30px;
        }
        .order-table {
            margin: 20px 0px;
        }
        .order-pagination {
            text-align: center;
        }
        .order-input-short {
            width: 160px;
        }
        a {
            color: #20a0ff;
        }
    }
}

</style>
